package com.example.tests;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;

import java.util.Random;

import org.testng.annotations.Test;

import com.example.fw.Folders;

public class FolderRemovalTests extends TestBase {
	@Test
	public void testFolderDeletion(){
		Folders oldFolders =app.getFolderHelper().getFolders(); 
		Random rnd = new Random();
		int	index = rnd.nextInt(oldFolders.size());
				
		assertThat(app.getFolderHelper().deleteFolderUsingMenu(index), is(nullValue()));
		Folders newFolders =app.getFolderHelper().getFolders();
		assertThat(newFolders, equalTo(oldFolders.without(index)));
	}
}
